$(function(){
     // 百度地图API功能
     var ZoomNum = 0;
     var map = new BMap.Map("map", {
       enableMapClick: false
     });    // 创建Map实例
     map.centerAndZoom(new BMap.Point(116.250438, 40.03487), 12);  // 初始化地图,设置中心点坐标和地图级别
     map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
     map.addEventListener("zoomend", function (e) {
       ZoomNum = map.getZoom();
     });


     //行政区域划分
     var pointArray = "116.328395,39.916983;116.328395,39.916663;116.328385,39.915973;116.328375,39.915353;116.328374,39.914643;116.328354,39.914113;116.328354,39.913923;116.328354,39.913773;116.328323,39.912732;116.328323,39.912542;116.328313,39.912022;116.328313,39.911952;116.328323,39.911482;116.328233,39.911322;116.328232,39.911192;116.328252,39.910902;116.328272,39.910692;116.328292,39.910532;116.328312,39.910412;116.328491,39.909812;116.32871,39.909333;116.328938,39.908713;116.328998,39.908553;116.329018,39.908483;116.329028,39.908463;116.329097,39.908203;116.329107,39.908124;116.329137,39.907744;116.329146,39.907433;116.329146,39.907343;116.329166,39.906393;116.329185,39.906273;116.329235,39.906093;116.329255,39.906023;116.329294,39.905913;116.329285,39.905773;116.329285,39.905723;116.329274,39.905123;116.329274,39.904543;116.329263,39.904383;116.329243,39.903923;116.329233,39.903472;116.329263,39.903293;116.329302,39.903183;116.329362,39.903053;116.329402,39.902983;116.329442,39.902923;116.329601,39.902733;116.32962,39.902713;116.32974,39.902594;116.32962,39.902183;116.329441,39.902022;116.329161,39.901932;116.329132,39.901922;116.328903,39.901841;116.328783,39.901801;116.328653,39.90173;116.328564,39.90165;116.328414,39.90148;116.328295,39.901339;116.328305,39.901249;116.328324,39.901019;116.328334,39.900559;116.328324,39.900529;116.328304,39.900519;116.328254,39.900499;116.328214,39.900489;116.328155,39.900479;116.328125,39.900449;116.328105,39.900408;116.328105,39.900348;116.328105,39.900278;116.328105,39.900108;116.328124,39.899768;116.328134,39.899448;116.328173,39.899138;116.328223,39.899079;116.328273,39.899009;116.328303,39.898929;116.328322,39.898498;116.328312,39.898289;116.328302,39.897878;116.328311,39.897298;116.328321,39.897158;116.328341,39.896938;116.328341,39.896838;116.328341,39.896678;116.32834,39.896468;116.32835,39.896118;116.32836,39.895978;116.32838,39.895818;116.32839,39.895678;116.326627,39.895581;116.326408,39.89557;116.325582,39.895545;116.325512,39.895545;116.323672,39.895503;116.323214,39.895519;116.323085,39.895519;116.322975,39.895517;116.322548,39.895524;116.32225,39.895522;116.321941,39.895519;116.321753,39.895517;116.321305,39.895503;116.321097,39.895511;116.320908,39.895509;116.320699,39.895527;116.320461,39.895565;116.319775,39.895578;116.319348,39.895574;116.319239,39.895572;116.31897,39.895569;116.318295,39.895552;116.318116,39.89555;116.317798,39.895536;116.317341,39.89553;116.317222,39.895539;116.316925,39.895525;116.316746,39.895533;116.316706,39.895533;116.31606,39.895524;116.315872,39.895532;116.315604,39.895538;116.315028,39.895551;116.314512,39.895564;116.314373,39.895562;116.313549,39.89556;116.31347,39.895559;116.313073,39.895563;116.312934,39.895571;116.311912,39.895556;116.311674,39.895552;116.31083,39.895539;116.310096,39.895538;116.309868,39.895524;116.30965,39.895521;116.309173,39.895533;116.308578,39.895534;116.308519,39.895533;116.307547,39.895467;116.307457,39.895456;116.307348,39.895434;116.307279,39.895423;116.30714,39.89536;116.306743,39.895184;116.306742,39.894594;116.30451,39.893787;116.304372,39.893754;116.304134,39.89371;116.303945,39.893667;116.303072,39.893482;116.301624,39.893028;116.301346,39.892583;116.301207,39.892551;116.30084,39.892455;116.300413,39.892288;116.300274,39.892235;116.300066,39.892142;116.299559,39.891904;116.298547,39.891517;116.298061,39.89131;116.301344,39.891083;116.301344,39.890273;116.301333,39.889562;116.297454,39.88959;116.297454,39.888649;116.297453,39.888549;116.297215,39.888215;116.296709,39.887757;116.296719,39.888418;116.296719,39.888497;116.296719,39.888598;116.296719,39.888668;116.296123,39.888618;116.295915,39.888605;116.295617,39.888581;116.294853,39.888519;116.294089,39.888468;116.293106,39.888474;116.293115,39.888394;116.293105,39.888314;116.293115,39.888244;116.293105,39.887884;116.293115,39.887434;116.291853,39.886557;116.291644,39.886404;116.291405,39.886211;116.291316,39.886149;116.290342,39.885457;116.290203,39.885455;116.289905,39.885451;116.289408,39.885455;116.28909,39.885462;116.28905,39.885461;116.289149,39.885552;116.289199,39.885603;116.289219,39.885663;116.289199,39.886273;116.28922,39.887103;116.28923,39.887274;116.289251,39.888314;116.289052,39.888312;116.289052,39.888402;116.289053,39.889932;116.289113,39.889983;116.289133,39.890003;116.289152,39.890023;116.289152,39.890043;116.289153,39.890343;116.289163,39.890614;116.289145,39.893504;116.289137,39.895565;116.289048,39.895564;116.288908,39.895572;116.288391,39.895396;116.287675,39.895428;116.285676,39.895428;116.28482,39.895441;116.284044,39.895434;116.281733,39.895458;116.280308,39.89546;116.277665,39.895441;116.277366,39.89542;116.277266,39.89541;116.276637,39.895429;116.276028,39.895348;116.275529,39.895308;116.27464,39.895308;116.273741,39.895298;116.271812,39.895292;116.270382,39.895228;116.269831,39.8952;116.269531,39.895191;116.26909,39.895174;116.268971,39.895175;116.26845,39.895188;116.26815,39.89519;116.26808,39.89519;116.267869,39.895201;116.267729,39.895202;116.267499,39.895204;116.266958,39.895208;116.266747,39.895209;116.266697,39.89521;116.265976,39.895215;116.265785,39.895057;116.264843,39.895055;116.26367,39.895046;116.262366,39.89504;116.26061,39.89504;116.260048,39.895017;116.258672,39.894955;116.258612,39.894956;116.258551,39.894956;116.258441,39.894958;116.253969,39.894914;116.253195,39.895147;116.253205,39.895417;116.253205,39.895516;116.253215,39.895676;116.253225,39.895836;116.253225,39.895946;116.250882,39.895945;116.250308,39.895925;116.249986,39.895931;116.247641,39.895952;116.247188,39.89596;116.246997,39.895963;116.247118,39.896041;116.247158,39.896071;116.247158,39.896151;116.247179,39.89689;116.247179,39.897261;116.24718,39.898121;116.24718,39.898531;116.24718,39.898601;116.24718,39.898681;116.247171,39.898981;116.247171,39.899061;116.247171,39.899521;116.247172,39.900272;116.247183,39.901572;116.247183,39.901972;116.247164,39.902563;116.247164,39.902653;116.247164,39.902752;116.247154,39.903073;116.247165,39.903943;116.247155,39.904983;116.247156,39.905103;116.247167,39.906054;116.247167,39.906113;116.247026,39.906116;116.247026,39.906186;116.247026,39.906266;116.247026,39.906586;116.247016,39.906766;116.246996,39.907077;116.246977,39.907667;116.246966,39.908127;116.246958,39.909118;116.246948,39.909828;116.246948,39.910709;116.246939,39.911629;116.24695,39.912419;116.24695,39.913729;116.246951,39.914189;116.246749,39.914183;116.245662,39.914172;116.244363,39.914156;116.243961,39.914153;116.243638,39.914158;116.243558,39.91417;116.243518,39.914191;116.243437,39.914272;116.243407,39.914353;116.243367,39.914504;116.243296,39.914675;116.243266,39.914755;116.243236,39.914776;116.243216,39.914796;116.243428,39.915173;116.243508,39.915441;116.243922,39.916734;116.243952,39.916734;116.246539,39.916607;116.246972,39.916449;116.246992,39.916679;116.24662,39.917016;116.245674,39.917772;116.245272,39.91864;116.246993,39.918739;116.246993,39.920659;116.246631,39.920606;116.24637,39.920551;116.246208,39.920484;116.246118,39.920445;116.245604,39.920194;116.245514,39.920196;116.245443,39.920177;116.245,39.920015;116.244537,39.919843;116.243953,39.919634;116.243711,39.919568;116.243621,39.91955;116.24352,39.919532;116.243399,39.919514;116.243298,39.919506;116.243117,39.919488;116.242654,39.919507;116.242201,39.919535;116.241597,39.919586;116.241315,39.919601;116.241305,39.919531;116.240932,39.917817;116.237045,39.917744;116.236854,39.917507;116.236823,39.917448;116.236813,39.917398;116.236843,39.917067;116.233904,39.917194;116.23338,39.917252;116.233149,39.917245;116.231589,39.917247;116.231488,39.916939;116.231448,39.916859;116.231408,39.91682;116.231337,39.9168;116.231297,39.916791;116.230885,39.916707;116.230864,39.916657;116.230865,39.916627;116.230974,39.915985;116.231005,39.915645;116.230723,39.915658;116.229254,39.915707;116.22845,39.915767;116.228349,39.915778;116.228218,39.91579;116.227746,39.915835;116.227575,39.915837;116.227364,39.91586;116.227203,39.915851;116.226962,39.915804;116.22664,39.915707;116.226509,39.915658;116.226359,39.91561;116.226218,39.915562;116.226117,39.915533;116.225997,39.915474;116.225896,39.915435;116.225856,39.915395;116.225835,39.915355;116.225826,39.915296;116.225835,39.915235;116.225846,39.915145;116.225856,39.915055;116.225645,39.915077;116.225624,39.915187;116.225604,39.915268;116.225574,39.915378;116.225564,39.915438;116.225554,39.915478;116.225544,39.915558;116.225514,39.915658;116.225484,39.915749;116.225464,39.915819;116.225434,39.915869;116.225393,39.91591;116.225364,39.91593;116.225313,39.91596;116.225273,39.915971;116.225223,39.915991;116.225042,39.916033;116.224941,39.916024;116.224851,39.916015;116.22468,39.915966;116.22461,39.915957;116.224539,39.915947;116.224408,39.915938;116.224338,39.915929;116.224248,39.91593;116.224157,39.915951;116.224067,39.915991;116.223997,39.916052;116.223946,39.916132;116.223906,39.916203;116.223866,39.916273;116.223816,39.916344;116.223756,39.916394;116.223666,39.916455;116.223425,39.916527;116.223263,39.916548;116.223003,39.91659;116.222952,39.9166;116.222822,39.916621;116.222661,39.916652;116.222581,39.916663;116.2225,39.916673;116.222339,39.916685;116.222169,39.916696;116.221978,39.916687;116.221526,39.91666;116.22005,39.916608;116.219599,39.91659;116.219288,39.916571;116.218956,39.916573;116.218696,39.916574;116.218505,39.916574;116.218144,39.916585;116.218013,39.916596;116.217943,39.916596;116.217753,39.916606;116.217582,39.916617;116.217351,39.916627;116.217201,39.916638;116.21702,39.916648;116.216669,39.916659;116.216579,39.916659;116.216429,39.916669;116.216078,39.916669;116.215988,39.91668;116.215496,39.91667;116.215176,39.91666;116.214945,39.91666;116.214454,39.91666;116.214284,39.91665;116.214023,39.916639;116.213813,39.916629;116.213532,39.916609;116.213392,39.916589;116.213322,39.916568;116.213252,39.916558;116.213131,39.916518;116.213001,39.916468;116.21265,39.916317;116.21253,39.916267;116.21235,39.916186;116.2122,39.916126;116.212059,39.916075;116.211979,39.916055;116.211889,39.916025;116.211809,39.915985;116.210678,39.916681;116.210328,39.916799;116.210228,39.916859;116.209397,39.916664;116.208476,39.916429;116.207956,39.916255;116.206785,39.915766;116.206526,39.915664;116.206466,39.915644;116.206406,39.915623;116.206325,39.915612;116.206226,39.915602;116.206106,39.915591;116.205946,39.915589;116.205866,39.915589;116.205786,39.915588;116.205596,39.915766;116.205466,39.915795;116.205276,39.915823;116.203198,39.916172;116.202509,39.916814;116.200791,39.916823;116.200701,39.916832;116.200712,39.917462;116.200712,39.917522;116.200722,39.918112;116.200752,39.919973;116.200753,39.920063;116.200763,39.920753;116.200773,39.921423;116.200803,39.923144;116.200803,39.923224;116.200803,39.923334;116.200803,39.923484;116.200803,39.923694;116.200973,39.923486;116.201113,39.923488;116.201572,39.923494;116.201682,39.923495;116.202741,39.923508;116.202911,39.92371;116.20294,39.92374;116.20302,39.923831;116.20326,39.923914;116.2034,39.923985;116.20411,39.924523;116.204679,39.924929;116.204779,39.924979;116.204889,39.925001;116.204949,39.925011;116.205169,39.925033;116.205419,39.925056;116.206029,39.925031;116.206238,39.925023;116.206509,39.925015;116.207189,39.925011;116.207249,39.925011;116.207429,39.925012;116.207479,39.925003;116.208859,39.925452;116.20969,39.926827;116.20977,39.927677;116.207709,39.927714;116.208148,39.930007;116.21039,39.9301;116.21039,39.93036;116.2101,39.930559;116.209529,39.931036;116.207718,39.931404;116.207718,39.932004;116.207708,39.932054;116.207708,39.932184;116.207708,39.932264;116.207708,39.932404;116.207708,39.932784;116.208568,39.93288;116.208508,39.933619;116.208007,39.933926;116.208527,39.934599;116.209947,39.936637;116.212459,39.939326;116.212849,39.939747;116.212869,39.939767;116.212897,39.943056;116.210353,39.943028;116.210431,39.946117;116.20986,39.946634;116.209249,39.947291;116.208889,39.947449;116.208708,39.947528;116.208538,39.947606;116.208238,39.947734;116.206807,39.948874;116.201657,39.95177;116.199,39.953654;116.197222,39.955107;116.196722,39.956388;116.196103,39.957018;116.19635,39.958811;116.195351,39.959964;116.192747,39.960899;116.190823,39.961363;116.189207,39.962492;116.185659,39.963831;116.184751,39.964353;116.185267,39.966672;116.182078,39.967378;116.180092,39.969338;116.179583,39.970698;116.18016,39.971829;116.180277,39.97547;116.180227,39.975689;116.179876,39.977282;116.180743,39.978309;116.180742,39.980039;116.180024,39.980744;116.180243,39.981148;116.180442,39.982382;116.180143,39.982936;116.179514,39.983704;116.178786,39.984639;116.178109,39.984906;116.177241,39.985189;116.175586,39.985718;116.174589,39.98607;116.173961,39.986409;116.172783,39.987028;116.172594,39.985165;116.172764,39.984248;116.172595,39.983116;116.172735,39.981918;116.172396,39.980982;116.17096,39.980539;116.169643,39.979138;116.16606,39.976368;116.165311,39.975579;116.163092,39.976014;116.1635,39.978958;116.163218,39.981884;116.162368,39.982316;116.161917,39.986001;116.161186,39.986435;116.159946,39.986105;116.159055,39.985758;116.157663,39.98456;116.156592,39.984345;116.154808,39.982938;116.15202,39.982505;116.151017,39.983485;116.149671,39.984117;116.150735,39.985535;116.149731,39.987027;116.149058,39.988129;116.148164,39.989022;116.144948,39.992308;116.14524,39.992506;116.146285,39.99354;116.147803,39.994073;116.148165,39.995642;116.150625,39.996966;116.155089,39.99865;116.155159,39.99868;116.159526,39.998872;116.162318,39.999145;116.163178,39.999434;116.163898,39.999152;116.167045,39.99965;116.167146,40.001112;116.167906,40.003133;116.170063,40.005085;116.167808,40.006292;116.167519,40.007218;116.166601,40.007806;116.165521,40.007552;116.164803,40.009034;116.163854,40.010063;116.162545,40.01044;116.161596,40.011621;116.160645,40.011673;116.158945,40.013231;116.159046,40.014142;116.158816,40.014951;116.154431,40.018072;116.153218,40.01819;116.151684,40.01986;116.15038,40.019781;116.148633,40.020866;116.147358,40.020911;116.145992,40.021688;116.144775,40.021285;116.142683,40.021261;116.138952,40.023749;116.137806,40.025613;116.135349,40.026354;116.133325,40.028053;116.132247,40.028449;116.127601,40.029704;116.126099,40.029859;116.124264,40.03011;116.122762,40.029705;116.120595,40.029353;116.119355,40.028643;116.118669,40.028685;116.116151,40.028846;116.115628,40.029305;116.115296,40.03025;116.113343,40.03051;116.111773,40.031213;116.109218,40.031918;116.106866,40.031766;116.105429,40.031311;116.1034,40.03142;116.100651,40.031061;116.100109,40.031165;116.09994,40.031196;116.098516,40.031453;116.097274,40.032129;116.096733,40.032431;116.094251,40.032836;116.092681,40.032636;116.090841,40.031833;116.089143,40.030768;116.086468,40.030575;116.081833,40.030627;116.079215,40.029879;116.078101,40.030386;116.074125,40.032203;116.072426,40.031907;116.069241,40.036248;116.069252,40.039018;116.06697,40.042801;116.063914,40.04739;116.064182,40.049764;116.062753,40.05097;116.062951,40.052383;116.064518,40.054899;116.065964,40.058983;116.065704,40.060998;116.063879,40.061807;116.062776,40.063268;116.061405,40.064374;116.059519,40.066393;116.060043,40.067551;116.06011,40.070121;116.05868,40.071997;116.056069,40.073256;116.054509,40.074473;116.052683,40.074128;116.052365,40.075213;116.0516,40.075353;116.051083,40.075566;116.050676,40.075761;116.048976,40.077811;116.047153,40.08155;116.046974,40.081979;116.046316,40.083512;116.044557,40.083867;116.04377,40.084681;116.043908,40.086772;116.04508,40.08763;116.045675,40.088785;116.046002,40.089987;116.047173,40.091097;116.048812,40.092104;116.049337,40.093819;116.050835,40.095726;116.05143,40.096183;116.056451,40.098484;116.057303,40.100706;116.057759,40.102063;116.059128,40.102515;116.06011,40.10302;116.061419,40.102822;116.06259,40.103022;116.06383,40.103723;116.064356,40.104271;116.064881,40.10538;116.065536,40.106791;116.067034,40.108046;116.06749,40.109153;116.067302,40.11027;116.068284,40.111326;116.068225,40.112735;116.068156,40.113594;116.068811,40.114655;116.070121,40.114546;116.072465,40.114193;116.074035,40.115396;116.075406,40.115496;116.07645,40.11666;116.077306,40.118011;116.078221,40.118313;116.079197,40.119225;116.084096,40.118103;116.084425,40.119116;116.087686,40.119206;116.090762,40.120368;116.09278,40.11795;116.09396,40.11779;116.094691,40.117589;116.094661,40.117559;116.094641,40.117519;116.094831,40.116929;116.095101,40.116089;116.095331,40.115349;116.095371,40.115228;116.097093,40.115164;116.097554,40.115822;116.100581,40.116956;116.103139,40.115337;116.10786,40.114178;116.108272,40.114473;116.108313,40.114453;116.108685,40.114418;116.109167,40.114442;116.109348,40.11444;116.109529,40.114447;116.110093,40.11445;116.110575,40.114463;116.110656,40.114473;116.110787,40.114471;116.111552,40.11449;116.114652,40.114544;116.114733,40.115333;116.114974,40.115339;116.115398,40.115352;116.116143,40.11536;116.116384,40.115366;116.116959,40.115367;116.11716,40.115364;116.117835,40.115373;116.118238,40.115376;116.118661,40.115379;116.118722,40.115378;116.118933,40.115385;116.119337,40.115388;116.119618,40.115393;116.119669,40.115392;116.120919,40.115401;116.121312,40.115405;116.121373,40.115414;116.121806,40.115406;116.122934,40.115427;116.124547,40.113889;116.125213,40.114018;116.126796,40.114331;116.126755,40.115362;116.126735,40.115922;116.127613,40.118588;116.12837,40.120466;116.143518,40.120202;116.144925,40.120231;116.146403,40.120283;116.148925,40.121192;116.149096,40.121232;116.152047,40.121848;116.15743,40.122722;116.162315,40.123709;116.165194,40.12281;116.164605,40.124923;116.162207,40.127058;116.163007,40.126966;116.164546,40.126733;116.165136,40.12665;116.167074,40.126264;116.165798,40.129638;116.165409,40.131544;116.164134,40.13554;116.161814,40.135226;116.161105,40.137521;116.159624,40.137549;116.159575,40.137939;116.159545,40.138188;116.159555,40.138579;116.163606,40.138055;116.163566,40.138364;116.163567,40.138775;116.163547,40.138924;116.163497,40.139214;116.163477,40.139394;116.163477,40.139454;116.163449,40.141254;116.167126,40.141268;116.168654,40.14126;116.168705,40.143181;116.172718,40.143405;116.172719,40.144865;116.17262,40.146124;116.175502,40.146085;116.175483,40.147095;116.175396,40.150504;116.176801,40.15062;116.176852,40.152001;116.178088,40.152035;116.178738,40.155508;116.177503,40.156844;116.179287,40.156469;116.182217,40.156387;116.185324,40.154419;116.187178,40.154806;116.187248,40.155167;116.187437,40.155871;116.187537,40.156273;116.187617,40.156535;116.187677,40.156706;116.187697,40.156796;116.187807,40.157148;116.187886,40.15741;116.187986,40.157762;116.188016,40.157853;116.188096,40.158124;116.188814,40.158368;116.189113,40.159244;116.193279,40.159442;116.193519,40.159936;116.197199,40.160058;116.197874,40.153077;116.198053,40.15176;116.198829,40.149261;116.199036,40.145633;116.199214,40.143825;116.199353,40.142847;116.20043,40.140872;116.201717,40.139788;116.204083,40.138694;116.205762,40.138561;116.207503,40.139225;116.209465,40.140888;116.210986,40.140955;116.212488,40.140339;116.213419,40.139891;116.216846,40.13821;116.217427,40.137909;116.223419,40.136338;116.227066,40.135044;116.229197,40.134739;116.236957,40.134396;116.242233,40.134015;116.240604,40.122591;116.239596,40.120048;116.239806,40.117874;116.23749,40.117644;116.23749,40.117594;116.237551,40.117303;116.237591,40.116992;116.237681,40.116491;116.237812,40.115758;116.237862,40.115517;116.237923,40.115216;116.238074,40.114204;116.238084,40.114184;116.238224,40.113381;116.238506,40.111906;116.238808,40.111431;116.237348,40.111146;116.237389,40.110236;116.237318,40.109407;116.235486,40.109256;116.235285,40.10821;116.235063,40.108013;116.234721,40.107789;116.233966,40.1073;116.238105,40.104914;116.239393,40.104432;116.241508,40.104525;116.243935,40.105252;116.24468,40.105478;116.246009,40.105424;116.248818,40.104005;116.25083,40.10349;116.25241,40.104093;116.253254,40.104879;116.253092,40.107572;116.252137,40.108357;116.251181,40.109523;116.252288,40.111215;116.253635,40.112353;116.254027,40.110697;116.254691,40.110456;116.255586,40.110572;116.256329,40.110301;116.257264,40.109968;116.258007,40.109337;116.258088,40.108416;116.258671,40.107508;116.258239,40.107124;116.258118,40.106636;116.25851,40.10604;116.258621,40.105639;116.258822,40.104947;116.258933,40.104585;116.258973,40.103925;116.259034,40.102754;116.258722,40.102658;116.257698,40.102292;116.256844,40.101995;116.256643,40.101918;116.255558,40.101544;116.254824,40.101275;116.25413,40.101046;116.253708,40.100913;116.253266,40.10077;116.253286,40.10074;116.253326,40.100639;116.253346,40.100499;116.253357,40.100399;116.253347,40.100329;116.253316,40.100269;116.253256,40.10019;116.253236,40.100161;116.253246,40.100101;116.253276,40.10005;116.253327,40.099989;116.253467,40.099887;116.254504,40.099161;116.256364,40.097793;116.256475,40.097721;116.257017,40.097333;116.25746,40.096987;116.258254,40.096426;116.2595,40.09558;116.25962,40.095478;116.260052,40.095193;116.260906,40.094553;116.261589,40.094105;116.262001,40.09382;116.264218,40.092528;116.266364,40.0913;116.266655,40.091127;116.267466,40.090641;116.268008,40.090328;116.268048,40.090308;116.269302,40.087032;116.269322,40.086972;116.269392,40.086791;116.269453,40.086621;116.269934,40.085739;116.271227,40.083325;116.271498,40.082804;116.271508,40.082784;116.271688,40.082553;116.272038,40.082093;116.272459,40.081312;116.273951,40.078551;116.274231,40.078691;116.280754,40.080794;116.282258,40.081263;116.282517,40.081354;116.282936,40.081467;116.284418,40.082058;116.284947,40.081113;116.285296,40.080437;116.285436,40.080168;116.285914,40.079323;116.286134,40.078895;116.286243,40.078706;116.286373,40.078468;116.286672,40.077901;116.286812,40.077652;116.287091,40.077135;116.28724,40.076867;116.28737,40.076628;116.287579,40.076371;116.287748,40.076083;116.288047,40.075556;116.288097,40.075517;116.288595,40.074263;116.293978,40.066346;116.297686,40.059074;116.300443,40.061188;116.300969,40.061137;116.304055,40.059149;116.307545,40.060426;116.307535,40.059447;116.307863,40.058782;116.309361,40.059206;116.309827,40.059353;116.311702,40.059951;116.312346,40.060112;116.314213,40.058809;116.314283,40.05873;116.316478,40.056659;116.316567,40.056531;116.316557,40.056431;116.318911,40.056049;116.318941,40.056039;116.319518,40.055395;116.319667,40.055237;116.320005,40.054871;116.320343,40.054494;116.320691,40.053998;116.32073,40.053948;116.32088,40.05401;116.321754,40.054428;116.321973,40.05453;116.32235,40.054033;116.322649,40.053625;116.322769,40.053716;116.322917,40.053827;116.323036,40.053918;116.323484,40.054252;116.323633,40.054363;116.324458,40.054979;116.324478,40.055039;116.324478,40.055059;116.324956,40.055412;116.325105,40.055533;116.325652,40.055956;116.326159,40.056339;116.326398,40.05646;116.326607,40.056551;116.326896,40.056652;116.327085,40.056703;116.328608,40.056989;116.329246,40.05711;116.33081,40.057393;116.331438,40.057503;116.332744,40.057752;116.332754,40.057692;116.332784,40.057582;116.332804,40.057522;116.333903,40.053881;116.337168,40.05412;116.337017,40.05504;116.336957,40.0555;116.336907,40.056041;116.336847,40.056771;116.336756,40.057931;116.336716,40.058241;116.336706,40.058301;116.336696,40.058401;116.336676,40.058471;116.337575,40.058637;116.337985,40.058704;116.339753,40.059032;116.340763,40.059204;116.340893,40.059223;116.340983,40.059242;116.340932,40.060123;116.340882,40.060783;116.340801,40.061643;116.340721,40.062344;116.341431,40.062467;116.342291,40.062629;116.342931,40.062763;116.343201,40.06282;116.343412,40.062858;116.344042,40.062971;116.344172,40.062999;116.344723,40.063103;116.345614,40.063282;116.346254,40.063414;116.346736,40.063518;116.346785,40.063537;116.346936,40.063565;116.347196,40.063591;116.347937,40.063761;116.349511,40.064048;116.350032,40.06414;116.350513,40.064202;116.350554,40.064212;116.350704,40.064239;116.350764,40.064238;116.351015,40.064274;116.351265,40.06428;116.351326,40.064289;116.351386,40.064288;116.351456,40.064307;116.351516,40.064336;116.351606,40.064385;116.353131,40.064579;116.353422,40.064624;116.357015,40.064659;116.356985,40.06469;116.356965,40.06473;116.356945,40.06482;116.356924,40.065051;116.356944,40.06531;116.356934,40.06544;116.356943,40.06719;116.356932,40.06759;116.364093,40.067431;116.364123,40.067911;116.366304,40.067068;116.365651,40.066441;116.365832,40.066258;116.366114,40.066052;116.366405,40.065887;116.36709,40.064194;116.368506,40.064307;116.368757,40.064372;116.368948,40.064429;116.369229,40.064503;116.3693,40.064522;116.36937,40.064531;116.36951,40.064558;116.369641,40.064576;116.370234,40.064605;116.370374,40.064612;116.370635,40.064637;116.370927,40.064672;116.371278,40.064705;116.371338,40.064714;116.37167,40.064758;116.372152,40.06481;116.372222,40.064819;116.374221,40.064015;116.375135,40.063279;116.376251,40.062132;116.376452,40.060989;116.376472,40.060929;116.376482,40.060829;116.376492,40.060769;116.376603,40.060187;116.376604,40.059698;116.376383,40.059241;116.373051,40.057356;116.3728,40.0573;116.371997,40.057105;116.371254,40.056918;116.370972,40.056853;116.370932,40.056844;116.370199,40.057527;116.368752,40.057154;116.367155,40.056665;116.366131,40.056485;116.36599,40.056177;116.36597,40.055828;116.36596,40.055518;116.366011,40.055247;116.366021,40.055177;116.366031,40.055107;116.367097,40.052667;116.364093,40.052075;116.36109,40.051484;116.36106,40.050635;116.36102,40.049716;116.363361,40.04558;116.365249,40.045783;116.365832,40.043412;116.368755,40.043735;116.371116,40.044002;116.371316,40.041738;116.373727,40.042336;116.373988,40.041131;116.378294,40.041574;116.379729,40.041175;116.381423,40.040113;116.383258,40.039753;116.384681,40.039809;116.38469,40.038578;116.38452,40.03712;116.383958,40.036085;116.384609,40.034799;116.385821,40.033868;116.387362,40.032706;116.388163,40.032111;116.388463,40.031809;116.388563,40.031709;116.388823,40.031447;116.38678,40.0309;116.385588,40.030689;116.383614,40.030507;116.383083,40.030473;116.379733,40.030283;116.373741,40.029874;116.373008,40.029816;116.372004,40.029744;116.369512,40.029289;116.368759,40.029133;116.367292,40.028821;116.36687,40.028749;116.366739,40.028722;116.365463,40.028506;116.360942,40.027615;116.360852,40.027596;116.357758,40.026976;116.354977,40.026707;116.352599,40.026548;116.34974,40.026144;116.346873,40.025675;116.34493,40.02547;116.345591,40.024622;116.345681,40.024521;116.34572,40.02448;116.345911,40.024317;116.346101,40.024165;116.346241,40.024083;116.347072,40.023792;116.347333,40.023709;116.347633,40.023614;116.348355,40.023394;116.348906,40.023196;116.349056,40.023144;116.349226,40.023081;116.349637,40.022915;116.349748,40.022863;116.349848,40.022802;116.349978,40.02271;116.350078,40.022618;116.350108,40.022598;116.350198,40.022506;116.350289,40.022405;116.350319,40.022364;116.350359,40.022294;116.350439,40.022172;116.350479,40.022102;116.350509,40.022031;116.350549,40.02189;116.350569,40.02179;116.350569,40.02173;116.350559,40.02156;116.350538,40.02145;116.350378,40.021053;116.350257,40.020805;116.350157,40.020606;116.350026,40.020388;116.349896,40.02016;116.349835,40.020031;116.349785,40.019922;116.349775,40.019882;116.349745,40.019742;116.349745,40.019572;116.349745,40.019452;116.349765,40.019362;116.349785,40.019291;116.349865,40.01915;116.349975,40.018979;116.350125,40.018766;116.350285,40.018554;116.350886,40.017794;116.350976,40.017672;116.351497,40.017004;116.351688,40.016751;116.351738,40.01669;116.352169,40.016132;116.352219,40.016062;116.352399,40.015828;116.35298,40.015068;116.353171,40.014815;116.353381,40.014571;116.353762,40.014085;116.354223,40.013486;116.354444,40.013172;116.354614,40.012949;116.355146,40.01252;116.355347,40.012356;116.355367,40.012336;116.355958,40.011725;116.356039,40.011623;116.356319,40.011238;116.3564,40.011106;116.3565,40.010914;116.35659,40.010723;116.35671,40.01045;116.356901,40.009927;116.357111,40.009583;116.357252,40.00937;116.357523,40.009055;116.357833,40.008619;116.358124,40.008243;116.358265,40.008061;116.358335,40.007979;116.358455,40.007817;116.358907,40.007208;116.359228,40.006792;116.359499,40.006416;116.359569,40.006325;116.360302,40.005311;116.360994,40.004387;116.361245,40.004022;116.361416,40.003799;116.361677,40.003443;116.361797,40.003271;116.361867,40.00318;116.362078,40.002855;116.36247,40.002278;116.363092,40.001455;116.363644,40.000694;116.363925,40.000299;116.363985,40.000228;116.364066,40.000116;116.364136,40.000035;116.364166,39.999994;116.364216,39.999933;116.364287,39.999852;116.364759,39.999192;116.36516,39.998674;116.36521,39.998613;116.365682,39.997994;116.365994,39.997618;116.366114,39.997486;116.366164,39.997415;116.366667,39.996775;116.366797,39.996612;116.367098,39.996227;116.367299,39.995953;116.367731,39.995374;116.367791,39.995303;116.368344,39.994603;116.368404,39.994521;116.368766,39.994075;116.368896,39.993912;116.369228,39.993466;116.36969,39.992877;116.3698,39.992725;116.36989,39.992614;116.370051,39.992401;116.370101,39.99233;116.370332,39.992025;116.370513,39.991752;116.370644,39.99155;116.370684,39.991489;116.370935,39.991024;116.371166,39.99057;116.371286,39.990308;116.371427,39.989955;116.371748,39.98903;116.37211,39.988003;116.372231,39.987751;116.372391,39.987548;116.372703,39.987353;116.372884,39.98726;116.373185,39.987085;116.373355,39.986991;116.373587,39.986858;116.373657,39.986817;116.373958,39.986652;116.37433,39.986465;116.374591,39.986371;116.374581,39.986191;116.37445,39.985993;116.37425,39.985827;116.374069,39.98574;116.373978,39.985691;116.373758,39.985555;116.373587,39.985408;116.373406,39.985221;116.373286,39.985073;116.373216,39.984964;116.373185,39.984875;116.373165,39.984775;116.373135,39.984646;116.373145,39.984496;116.373166,39.984265;116.373256,39.983914;116.373316,39.983683;116.373447,39.98325;116.373518,39.982929;116.373678,39.982297;116.373859,39.981544;116.37397,39.981102;116.37401,39.980901;116.374051,39.980771;116.374272,39.979977;116.374282,39.979937;116.374382,39.979615;116.374554,39.979023;116.374866,39.977878;116.374936,39.977617;116.374996,39.977416;116.375027,39.977275;116.375077,39.977095;116.375097,39.977014;116.375157,39.976773;116.375188,39.976643;116.375228,39.976482;116.375268,39.976272;116.375309,39.975961;116.375329,39.975781;116.375349,39.975521;116.375359,39.97546;116.375359,39.9754;116.375369,39.97535;116.375369,39.97528;116.375369,39.97526;116.37537,39.97503;116.37536,39.974901;116.37535,39.974801;116.37534,39.974561;116.37534,39.974451;116.37533,39.974391;116.37531,39.974161;116.37526,39.973802;116.37525,39.973703;116.37524,39.973513;116.375241,39.973123;116.375231,39.972483;116.375221,39.972413;116.375221,39.972234;116.375201,39.971944;116.375152,39.971595;116.375092,39.971216;116.375012,39.970478;116.374992,39.970288;116.374982,39.970188;116.374932,39.969839;116.374912,39.969689;116.374863,39.96922;116.374823,39.968991;116.374723,39.968323;116.374743,39.968253;116.374793,39.968102;116.374834,39.968031;116.374834,39.968011;116.374864,39.967961;116.374894,39.96791;116.374994,39.967788;116.375085,39.967697;116.375135,39.967646;116.375175,39.967616;116.375255,39.967574;116.375306,39.967554;116.375406,39.967532;116.375457,39.967521;116.375647,39.967498;116.375818,39.967476;116.376039,39.967422;116.376089,39.967401;116.376129,39.967391;116.376671,39.967232;116.377043,39.967127;116.377043,39.967027;116.377053,39.966897;116.377063,39.966767;116.376993,39.966638;116.37616,39.966331;116.376,39.966263;116.3759,39.966235;116.375729,39.966217;116.374986,39.966199;116.374595,39.966196;116.374514,39.966187;116.374474,39.966178;116.374434,39.966169;116.374394,39.966149;116.374364,39.96612;116.374324,39.96607;116.374143,39.965913;116.374002,39.965906;116.373812,39.965899;116.373781,39.966029;116.373741,39.9661;116.373701,39.966171;116.373681,39.966191;116.373651,39.966192;116.37361,39.966202;116.37337,39.966196;116.372737,39.966177;116.372185,39.966257;116.372064,39.966279;116.371783,39.966384;116.371712,39.966405;116.371531,39.966438;116.37114,39.966475;116.370397,39.966469;116.369252,39.96644;116.368769,39.96641;116.368528,39.966404;116.368227,39.96639;116.367504,39.966364;116.366821,39.966337;116.364631,39.966269;116.364269,39.966267;116.364189,39.966158;116.364169,39.966119;116.364159,39.966039;116.364179,39.965828;116.36425,39.964987;116.364301,39.964607;116.364301,39.964586;116.364352,39.963996;116.364413,39.963385;116.364444,39.962924;116.364494,39.962484;116.364515,39.962273;116.364657,39.960811;116.364677,39.960521;116.364687,39.960411;116.364718,39.96006;116.364758,39.959709;116.364779,39.959439;116.364799,39.959269;116.364891,39.958307;116.364931,39.957767;116.365043,39.956715;116.365043,39.956645;116.365053,39.956555;116.365063,39.956475;116.365135,39.955684;116.365155,39.955513;116.365185,39.955223;116.365216,39.954882;116.365246,39.954622;116.365287,39.954161;116.365358,39.95344;116.36544,39.952459;116.36546,39.952279;116.365541,39.951397;116.365592,39.950807;116.365602,39.950756;116.365612,39.950636;116.365633,39.950346;116.365653,39.950146;116.365694,39.949775;116.365583,39.949657;116.365593,39.949537;116.365654,39.948826;116.365735,39.948025;116.365766,39.947654;116.365796,39.947424;116.365615,39.947397;116.365515,39.947389;116.365405,39.947382;116.365214,39.947355;116.365083,39.947338;116.364872,39.947302;116.364259,39.947174;116.363988,39.947099;116.363868,39.947052;116.363587,39.946977;116.362723,39.946674;116.362281,39.946513;116.36213,39.946456;116.361628,39.946256;116.360705,39.945904;116.360645,39.945875;116.360153,39.945655;116.35943,39.945359;116.359279,39.945292;116.358767,39.945122;116.358496,39.945027;116.358356,39.94499;116.358235,39.944952;116.357824,39.94484;116.357422,39.944717;116.357201,39.944652;116.356459,39.944455;116.356198,39.94439;116.355485,39.944183;116.354371,39.943873;116.353438,39.94361;116.353328,39.943582;116.353208,39.943554;116.353097,39.943516;116.352997,39.943487;116.352937,39.943468;116.352606,39.943384;116.351884,39.943176;116.351833,39.943167;116.351021,39.94294;116.35048,39.942799;116.350239,39.942733;116.350199,39.942783;116.350199,39.942883;116.350229,39.943253;116.350239,39.943313;116.350259,39.943412;116.350339,39.943691;116.350329,39.943771;116.350329,39.943871;116.350318,39.944891;116.350307,39.946091;116.350296,39.946261;116.350296,39.946381;116.350296,39.946511;116.350296,39.946711;116.350275,39.947261;116.350275,39.947761;116.350255,39.948021;116.350245,39.948071;116.350224,39.948221;116.350194,39.948322;116.350134,39.948563;116.350124,39.948633;116.349953,39.949155;116.349701,39.949929;116.349581,39.950291;116.349481,39.950402;116.34943,39.950383;116.34929,39.950345;116.34916,39.950317;116.348949,39.95025;116.347246,39.949784;116.346024,39.949481;116.345684,39.949355;116.345363,39.949189;116.345294,39.94891;116.345184,39.948322;116.345085,39.947723;116.344906,39.946345;116.344917,39.945446;116.345549,39.943549;116.34578,39.942886;116.34577,39.942606;116.34553,39.942349;116.34549,39.94232;116.34539,39.942241;116.34526,39.942173;116.34509,39.942065;116.344479,39.941692;116.344098,39.941596;116.343739,39.94162;116.343408,39.941684;116.343128,39.941747;116.341877,39.942069;116.341187,39.942205;116.339957,39.942226;116.337738,39.94201;116.336669,39.941836;116.336529,39.941827;116.33637,39.941817;116.335531,39.941781;116.334233,39.941835;116.333475,39.941756;116.332927,39.941697;116.332069,39.941568;116.330543,39.941827;116.330105,39.941826;116.329946,39.941826;116.32873,39.942163;116.328073,39.942121;116.326987,39.942677;116.326589,39.942815;116.326011,39.942672;116.325435,39.942319;116.324728,39.942054;116.324519,39.942013;116.323714,39.941837;116.32278,39.94151;116.322004,39.941144;116.322263,39.940866;116.322422,39.940677;116.322571,39.940159;116.322771,39.939551;116.32296,39.938942;116.323388,39.938556;116.324433,39.937743;116.324572,39.937624;116.325756,39.937202;116.325916,39.937092;116.326115,39.936944;116.326314,39.936805;116.326722,39.936767;116.326842,39.936677;116.326871,39.936657;116.326901,39.936628;116.326941,39.936578;116.326961,39.936488;116.326911,39.936418;116.326881,39.936378;116.326902,39.936148;116.326922,39.935958;116.326952,39.935658;116.327012,39.934898;116.327062,39.934539;116.327101,39.934259;116.327142,39.933859;116.327251,39.93296;116.327371,39.93178;116.327431,39.931261;116.327441,39.931181;116.327451,39.931051;116.327461,39.930961;116.327581,39.930251;116.327611,39.930061;116.32766,39.929792;116.32768,39.929652;116.3277,39.929492;116.32772,39.929382;116.32775,39.928972;116.32782,39.928382;116.32786,39.927942;116.32788,39.927702;116.32788,39.927632;116.327949,39.926843;116.327989,39.926443;116.328029,39.925973;116.328059,39.925503;116.328168,39.924263;116.328248,39.923233;116.328277,39.922813;116.328288,39.922664;116.328298,39.922504;116.328347,39.921874;116.328377,39.921854;116.328397,39.921834;116.328417,39.921814;116.328447,39.921774;116.328447,39.921644;116.328437,39.921494;116.328446,39.920324;116.328406,39.918164;116.328395,39.916983"
        var ply = new BMap.Polyline(pointArray, { strokeWeight: 2, strokeColor: "#ff0000" }); //建立多边形覆盖物
     map.addOverlay(ply);
     $("#closecar").click(function () {
       $(".sp_right").css("display", "none");
     })

     $(".pimg").click(function () {

       var _this = $(this);//将当前的pimg元素作为_this传入函数  
       imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
     });


     function wkkid(id){
       var devid="";
       $.each(dwData,function(i,row){
         var bool=confirmEnding(row.devId,id);
         if(bool){
           devid=row.devId;
           
         }
       })
       return devid;
     }
     function confirmEnding(str, target) {
   // 请把你的代码写在这里
    var start = str.length-target.length;
     var arr = str.substr(start,target.length);
     if(arr == target){
     return true;
     }
  return false;
 }
     //放大地图
     $("#amplification").click(function () {
       map.setZoom(map.getZoom() + 1);
     })
     //缩小地图
     $("#shrink").click(function () {
       map.setZoom(map.getZoom() - 1);
     })
     //回到初始地图
     $("#dinwei").click(function () {
       map.centerAndZoom(new BMap.Point(116.295438, 39.996487), 12);
     })
     //摄像头点位上图
     var mapvLayer = "";
     var mapvLayerjuhe = "";
     var coordinatesData = [];
     var coordinatesDataImg = [];
     var dwData = [];
     var geoCoord = [];
     var devName = "";
     var ZoomNum = map.getZoom();
     $.ajax({
       type: 'get',
       dataType: "json",
       async: false,
       data: {
         httpurl: "/cloudSearch/search/basic?table=awkk&page_size=8855&data_type=1"
       },
       url: "http://11.16.127.79:5013/VIAS/web/snapshot/baidu/BayonetMarking",
       success: function (data) {
         $("div[title='显示普通地图']").hide();
         $("div[title='显示带有街道的卫星影像']").hide();
         dwData = data.data.list;
         $.each(dwData, function (i, row) {
           if(row.bayonet=="1"){
             var id=row.devName.substr(0,5);
             var devid=wkkid(id);
             coordinatesData.push({
             geometry: {
               type: 'Point',
               coordinates: row.location.coordinates,
               devname: row.devName,
               devid: devid,
               streetname:row.streetname,
               bayonet: row.bayonet
             }
           })
           }else{
             coordinatesData.push({
             geometry: {
               type: 'Point',
               coordinates: row.location.coordinates,
               devname: row.devName,
               devid: row.devId,
               streetname:row.streetname,
               bayonet: row.bayonet
             }
           })
           }
          
         })

       }
     });
     function weixin(i) {
       if (i == 2) {
         $("div[title='显示带有街道的卫星影像']").click();
       } else {
         $("div[title='显示普通地图']").click();
       }

     }
     var dataSet1 = new mapv.DataSet(coordinatesData);
     var options = {
       shadowColor: 'rgba(255, 250, 50, 1)',
       shadowBlur: 10,
       fillStyle: 'rgba(255, 50, 0, 1.0)', // 非聚合点的颜色
       size: 5, // 非聚合点的半径
       minSize: 25, // 聚合点最小半径
       maxSize: 25, // 聚合点最大半径
       globalAlpha: 0.6, // 透明度
       clusterRadius: 200, // 聚合像素半径
       methods: {
         click: function (item) {
           //console.log(item);  // 点击事件
         }
       },
       maxZoom: 15, // 最大显示级别
       label: { // 聚合文本样式
         show: true, // 是否显示
         fillStyle: 'white',
       },
       gradient: { 0.5: 'blue', 1.0: "blue" }, // 聚合图标渐变色
       draw: 'cluster'
     }
     mapvLayerjuhe = new mapv.baiduMapLayer(map, dataSet1, options);
     mapvLayerjuhe.show();
     var img = new Image();
      img.src = 'images/wkk4.png';
     var img1 = new Image();
     img1.src = 'images/qji2.png';
     img.onload = function () {
       $.each(dwData, function (i, row) {
         if (row.bayonet == "") {
           coordinatesDataImg.push({
             geometry: {
               type: 'Point',
               coordinates: row.location.coordinates,
               devname: row.devName,
               devid: row.devId,
               bayonet: row.bayonet
             },
             icon: img1
           })
         } else {
          
           coordinatesDataImg.push({
             geometry: {
               type: 'Point',
               coordinates: row.location.coordinates,
               devname: row.devName,
               devid:row.devId,
               bayonet: row.bayonet

             },
             icon: img
           })
         }

       });

       var dataSet = new mapv.DataSet(coordinatesDataImg);
       var optionsImg = {
         draw: 'icon',
         methods: {
           //  mouseover: function (item) {
           //      if (ZoomNum >= 15 && item) {
           //          alert(item.geometry.devname);
           //      }
           //  },
           click: function (item, event) { // 鼠标移动事件，对应鼠标经过的元素对象值
             if (ZoomNum >= 15 && item) {
               console.log(item.geometry.devname)
               console.log(event);
               var opts={
                   width:100,
                   height:30,
               }
               var info=new BMap.InfoWindow(item.geometry.devname,opts);
               map.openInfoWindow(info,new BMap.Point(item.geometry.coordinates[0],item.geometry.coordinates[1]));
           }
           }
         },
         width: 30, // 规定图像的宽度
         height: 30, // 规定图像的高度
       }
       mapvLayer = new mapv.baiduMapLayer(map, dataSet, optionsImg);
       mapvLayer.hide();
     }

     map.addEventListener("zoomend", function (e) {

       if (ZoomNum > 15) {
         mapvLayerjuhe.hide();//隐藏聚合图层

         mapvLayer.show();//显示不聚合图层

       } else {//如果小于15层继续聚合
         mapvLayer.hide();//隐藏不聚合图层
         mapvLayerjuhe.show();
       }
     });


  
   //搜索框功能实现 

     //第一页
     var page = 1;
     //一页7条
     var rows = 7;
     //总数
     var total = 0;
     var _html = "";
     var list = [];
     var overlays = [];
     $(".sp_sch_btn").click(function () {
       var list = [];
       var classvalue = $("#schoptions").attr("class");
       var id = $("input[class='sp_sch_input gdgl_sch_input']").val();
       if (classvalue == "sp_sch_jwzy") {
         $.each(coordinatesData, function (i, row) {
           if (row.geometry.devname.indexOf(id) >= 0) {
             list.push({
               maker: row.geometry
             });
           } else if (row.geometry.devid.indexOf(id) >= 0) {
             list.push({
               maker: row.geometry
             });
           }
         });
         inoflist(list);
       } else {
         $.each(worksites, function (i, row) {
           if (row.zhenming.indexOf(id) >= 0) {
             list.push({
               maker: row
             });
           }
         });
         inoflist(list);
       }
     })
     function inoflist(list) {
       let arr = list;
       let sbs = new Array();
       for (let i = 0; i < arr.length; i++) {
         let sb = new Object();
         sb.DeviceId = arr[i].maker.devId;
         sbs.push(sb);
       }
       window.parent.postMessage(sbs, "*");
       _html = "";
       $("#sql_con").empty();
       var startRow = (page - 1) * rows;
       var endRow = startRow + rows;
       var tempData = list.slice(startRow, endRow);
       $.each(tempData, function (i, item) {
        
           if (item.maker.bayonet == "") {
             _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.maker.coordinates[0]}" lat="${item.maker.coordinates[1]}" devname="${item.maker.devname}" devid="${item.maker.devid}" style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.maker.devname}">${item.maker.devname}</h4><p>非微卡口</p><p>${item.maker.streetname}</p></div></div>`;
           } else {
           
             _html += `<div class="spl_res_item"   onclick="bayonet(this);" lon="${item.maker.coordinates[0]}" lat="${item.maker.coordinates[1]}" devname="${item.maker.devname}" devid="${item.maker.devid}" style="cursor:pointer;"  data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/wkk4.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.maker.devname}">${item.maker.devname}</h4><p>微卡口</p><p>${item.maker.streetname}</p></div></div>`;
           }
        
       });
       $("#total").text(list.length);
       total = list.length;
       $("#sql_con").empty();
       $("#spl_con").html(_html);

       //分页
       layui.use(['laypage', 'layer'], function () {
         var laypage = layui.laypage;
         laypage.render({
           //存放分页的div
           elem: 'spl_pages',
           //查询到的数据总数
           count: total,
           //每页显示的行数
           limit: rows,
           curr: page,
           layout: ['prev', 'page', 'next', 'refresh', 'skip'],
           jump: function (obj, first) {
             page = obj.curr;
             limit = obj.limit;
             if (!first) {
               _html = "";
               startRow = (page - 1) * rows;
               endRow = startRow + rows;
               tempData = list.slice(startRow, endRow);
               $.each(tempData, function (i, item) {
                 if (item.maker.OBJECTID != null) {
                   if (item.maker.bayonet == "") {
                     _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.maker.location.coordinates[0]}" lat="${item.maker.location.coordinates[1]}"  devname="${item.maker.devName}" devid="${item.maker.devId}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.maker.devName}">${item.maker.devName}</h4><p>非微卡口</p><p>${item.maker.streetname}</p></div></div>`;
                   } else {
                     _html += `<div class="spl_res_item"   onclick="bayonet(this);" lon="${item.maker.location.coordinates[0]}" lat="${item.maker.location.coordinates[1]}"  devname="${item.maker.devName}" devid="${item.maker.devId}" style="cursor:pointer;"  ><div class="spl_res_icon" ><img src="images/sp_licon8.png"><img src="images/wkk4.png"></div><div class="spl_res_txt"><h4  title="${item.maker.devName}">${item.maker.devName}</h4><p>微卡口</p><p>${item.maker.streetname}</p></div></div>`;
                   }
                 } else {
                   locations = item.maker.location.coordinates[0][item.maker.location.coordinates[0].length - 1];
                   _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.maker.address}"   style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.maker.zhenming}">${item.maker.zhenming}工地</h4><p>${item.maker.bhhdlmc}</p><p style="width: 250px">${item.maker.address}</p></div></div>`;
                 }

               });
               $("#sql_con").empty();
               $("#spl_con").html(_html);
             }
           }
         });
       });

     }

   //添加鼠标画图功能

     //第一页
     var page = 1;
     //一页7条
     var rows = 7;
     //总数
     var total = 0;
     var _html = "";
     var list = [];
     var overlays = [];
     var locations = [];
     //鼠标绘图监听事件
     var overlaycomplete = function (e) {
       console.log(e.overlay);
       overlays.push(e.overlay);
       getInfo();
     };
     //清空标注物事件
     $("#delete").click(function () {
       clearAll();
       _html = "";
       list = [];
     })
     var styleOptions = {
       strokeColor: "red",    //边线颜色。
       fillColor: "blue",      //填充颜色。当参数为空时，圆形将没有填充效果。
       strokeWeight: 3,       //边线的宽度，以像素为单位。
       strokeOpacity: 0.8,    //边线透明度，取值范围0 - 1。
       fillOpacity: 0.3,      //填充的透明度，取值范围0 - 1。
       strokeStyle: 'solid' //边线的样式，solid或dashed。
     }

     //实例化鼠标绘制工具
     var drawingManager = new BMapLib.DrawingManager(map, {
       isOpen: false, //是否开启绘制模式
       enableDrawingTool: true, //是否显示工具栏
       drawingToolOptions: {
         anchor: BMAP_ANCHOR_TOP_RIGHT, //位置
         offset: new BMap.Size(10, 70), //偏离值
         drawingModes: [
           BMAP_DRAWING_CIRCLE,
           BMAP_DRAWING_POLYGON,//多边形暂时有问题
           BMAP_DRAWING_RECTANGLE
         ],
       },
       circleOptions: styleOptions, //圆的样式
       polylineOptions: styleOptions, //线的样式
       polygonOptions: styleOptions, //多边形的样式
       rectangleOptions: styleOptions //矩形的样式

     });
     //添加鼠标绘制工具监听事件，用于获取绘制结果
     drawingManager.addEventListener('overlaycomplete', overlaycomplete);

     function clearAll() {
       var options = getOptions('poi');
       console.log(options);
       for (var i = 0; i < overlays.length; i++) {
         map.removeOverlay(overlays[i]);
       }
       overlays.length = 0
     }

     //点击卡口  播放视频
     var sbs=[];
     function bayonet(event) {
       var video = document.getElementById("myVideo");
       var opts={
                   width:100,
                   height:30,
               }
         var lon = event.getAttribute("lon");
         var lat = event.getAttribute("lat");
         var name= event.getAttribute("devname");
         var devId= event.getAttribute("devid");
         map.centerAndZoom(new BMap.Point(lon, lat), 17);
         var info=new BMap.InfoWindow(name,opts);
         map.openInfoWindow(info,new BMap.Point(lon,lat));
         let sb = new Object();
         sb.DeviceId = devId;
           sbs.push(sb);
         window.parent.postMessage(sbs, "*");
     };
     //微卡口点击信息
     function bayonetwkk(event) {
       var parma = "";
       if (event.geometry != null) {
         parma = '?deviceId=' + event.geometry.devid;
       } else {
         parma = '?deviceId=' + event.getAttribute("devid");
       }

       layui.use('layer', function () {
         var layer = layui.layer;
         layer.open({
           type: 2,
           fixed: true,
           title: ['卡口详情', 'font-size: 22px;color: rgb(49, 70, 89);'],
           closeBtn: 1,
           scrollbar: false,
           maxmin: false,
           content: 'jiaotong/shishiSP1.html' + parma,
           area: ['100%', '100%'],
           end: function () {
             // 暂时不用
           }
         });
       });
     }


     //视频关闭按钮
     $("#closevideo").click(function () {
       $(".video").css("display", "none");
     })
    
 
     //
     // 定义一个控件类,即function
     function ZoomControl() {
       // 默认停靠位置和偏移量
       this.defaultAnchor = BMAP_ANCHOR_TOP_LEFT;
       this.defaultOffset = new BMap.Size(10, 10);
     }
     function getInfo() {
       _html = "";
       page = 1;
       $(".spl_res").addClass("spl_show")
       $(".spl_abtn span").html("<")
       var options = getOptions('poi');
       console.log(options);
       if (options != null) {
         if (options.radius != null) {
           if (options.radius != 0) {
             var location = options.location.split(",");
             var radius = options.radius;
             $.ajax({
               type: "get",
               dataType: "json",

               data: {
                 httpurl: "roadseg?index=dugis_ut_awkk&type=default&location=" + location[0] + "," + location[1] + "&radius=" + radius + "&output=json&page_size=8855"

               },
               url: "http://11.16.127.79:5013/VIAS/web/snapshot/baidu/CircularSearch",
               success: function (data) {
                 console.log(data);
               
                 if (data.status == 0) {
                   $.each(data.results,function(i,row){
                    if(row.bayonet=="1"){
                     var id=row.devName.substr(0,5);
                   var devid=wkkid(id);
                   row.devId=devid;
                    }
                 })
                   $("#sql_con").empty();
                   var startRow = (page - 1) * rows;
                   var endRow = startRow + rows;
                   if (list.length > 0) {
                     $.each(data.results, function (i, row) {
                       for (var j = 0; j < list.length; j++) {
                         if (row.devId == list[j].devId) {
                           data.results.splice(i, 1);
                           break;
                         }
                       }
                     })
                     list = data.results.concat(list)
                   } else {
                     list = data.results;
                   }

                   let arr = list;
                   let sbs = new Array();
                   for (let i = 0; i < arr.length; i++) {
                     let sb = new Object();
                     sb.DeviceId = arr[i].devId;
                     sbs.push(sb);
                   }
                   window.parent.postMessage(sbs, "*");
                   var tempData = list.slice(startRow, endRow);
                   $.each(tempData, function (i, item) {
                     if (item.OBJECTID != null) {
                       if (item.bayonet == "") {
                         _html += `<div class="spl_res_item"  onclick="bayonet(this);"  lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}" devid="${item.devId}" devname="${item.devName}" style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>非微卡口</p><p>${item.streetname}</p></div></div>`;
                       } else {
                         _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}" devid="${item.devId}" devname="${item.devName}"  style="cursor:pointer;"  data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/wkk4.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>微卡口</p><p>${item.streetname}</p></div></div>`;
                       }
                     } else {
                       locations = item.location.coordinates[0][item.location.coordinates[0].length - 1];
                       _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.address}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.zhenming}">${item.zhenming}工地</h4><p>${item.bhhdlmc}</p><p style="width: 250px">${item.address}</p></div></div>`;
                     }
                   });
                   $("#total").text(list.length);
                   total = list.length;
                   $("#sql_con").empty();
                   $("#spl_con").html(_html);

                   //分页
                   layui.use(['laypage', 'layer'], function () {
                     var laypage = layui.laypage;
                     laypage.render({
                       //存放分页的div
                       elem: 'spl_pages',
                       //查询到的数据总数
                       count: total,
                       //每页显示的行数
                       limit: rows,
                       curr: page,
                       layout: ['prev', 'page', 'next', 'refresh', 'skip'],
                       jump: function (obj, first) {
                         page = obj.curr;
                         limit = obj.limit;
                         if (!first) {
                           _html = "";
                           startRow = (page - 1) * rows;
                           endRow = startRow + rows;
                           tempData = list.slice(startRow, endRow);
                           $.each(tempData, function (i, item) {

                             if (item.OBJECTID != null) {
                               if (item.bayonet == "") {
                                 _html += `<div class="spl_res_item"  onclick="bayonet(this);"  lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>非微卡口</p><p>${item.streetname}</p></div></div>`;
                               } else {
                                 _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"  style="cursor:pointer;"  data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/wkk4.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>微卡口</p><p>${item.streetname}</p></div></div>`;
                               }
                             } else {
                               locations = item.location.coordinates[0][item.location.coordinates[0].length - 1];
                               _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.address}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.zhenming}">${item.zhenming}工地</h4><p>${item.bhhdlmc}</p><p style="width: 250px">${item.address}</p></div></div>`;
                             }
                           });
                           $("#sql_con").empty();
                           $("#spl_con").html(_html);
                         }
                       }
                     });
                   });


                 }
               }
             });
           }
         } else if (options.xys != null) {
           console.log(options.xys);
           var xys = options.xys.split(";");
           if (xys.length != 4) {

             $.ajax({
               type: "get",
               dataType: "json",

               data: {
                 httpurl: "roadseg?index=dugis_ut_awkk&type=default&output=json&xys=" + options.xys + "&page_size=564"

               },
               url: "http://11.16.127.79:5013/VIAS/web/snapshot/baidu/RectangleRetrievel",
               success: function (data) {
                 console.log(data);
               
                 if (data.status == 0) {
                   $.each(data.results,function(i,row){
                    if(row.bayonet=="1"){
                     var id=row.devName.substr(0,5);
                   var devid=wkkid(id);
                   row.devId=devid;
                    }
                 })
                   $("#sql_con").empty();
                   var startRow = (page - 1) * rows;
                   var endRow = startRow + rows;
                   if (list.length > 0) {
                     $.each(data.results, function (i, row) {
                       for (var j = 0; j < list.length; j++) {
                         if (row.devId == list[j].devId) {
                           data.results.splice(i, 1);
                           break;
                         }
                       }
                     })
                     list = data.results.concat(list)
                   } else {
                     list = data.results;
                   }

                   let arr = list;
                   let sbs = new Array();
                   for (let i = 0; i < arr.length; i++) {
                     let sb = new Object();
                     sb.DeviceId = arr[i].devId;
                     sbs.push(sb);
                   }
                   window.parent.postMessage(sbs, "*");
                   var tempData = list.slice(startRow, endRow);
                   $.each(tempData, function (i, item) {
                     if (item.OBJECTID != null) {
                       if (item.bayonet == "") {
                         _html += `<div class="spl_res_item"  onclick="bayonet(this);" style="cursor:pointer;" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"  data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>非微卡口</p><p>${item.streetname}</p></div></div>`;
                       } else {
                         _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}" style="cursor:pointer;" devid="${item.devId}" devname="${item.devName}"  data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/wkk4.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>微卡口</p><p>${item.streetname}</p></div></div>`;
                       }
                     } else {
                       locations = item.location.coordinates[0][item.location.coordinates[0].length - 1];
                       _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.address}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.zhenming}">${item.zhenming}工地</h4><p>${item.bhhdlmc}</p><p style="width: 250px">${item.address}</p></div></div>`;
                     }
                   });
                   $("#total").text(list.length);
                   total = list.length;
                   $("#sql_con").empty();
                   $("#spl_con").html(_html);

                   //分页
                   layui.use(['laypage', 'layer'], function () {
                     var laypage = layui.laypage;
                     laypage.render({
                       //存放分页的div
                       elem: 'spl_pages',
                       //查询到的数据总数
                       count: total,
                       //每页显示的行数
                       limit: rows,
                       curr: page,
                       layout: ['prev', 'page', 'next', 'refresh', 'skip'],
                       jump: function (obj, first) {
                         page = obj.curr;
                         limit = obj.limit;
                         if (!first) {
                           _html = "";
                           startRow = (page - 1) * rows;
                           endRow = startRow + rows;
                           tempData = list.slice(startRow, endRow);
                           $.each(tempData, function (i, item) {
                             if (item.OBJECTID != null) {
                               if (item.bayonet == "") {
                                 _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>非微卡口</p><p>${item.streetname}</p></div></div>`;
                               } else {
                                 _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"   style="cursor:pointer;"  data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/wkk4.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>微卡口</p><p>${item.streetname}</p></div></div>`;
                               }
                             } else {
                               locations = item.location.coordinates[0][item.location.coordinates[0].length - 1];
                               _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.address}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.zhenming}">${item.zhenming}工地</h4><p>${item.bhhdlmc}</p><p style="width: 250px">${item.address}</p></div></div>`;
                             }
                           });
                           $("#sql_con").empty();
                           $("#spl_con").html(_html);
                         }
                       }
                     });
                   });


                 }
               }
             });
           } else {
             if (xys[0] != xys[1]) {
               var bounds1 = xys[1].split(",");
               var bounds2 = xys[3].split(",");

               $.ajax({
                 type: "get",
                 dataType: "json",

                 data: {
                   httpurl: "roadseg?index=dugis_ut_awkk&type=default&output=json&bounds=" + bounds2[0] + "," + bounds2[1] + "," + bounds1[0] + "," + bounds1[1] + "&page_size=564"

                 },
                 url: "http://11.16.127.79:5013/VIAS/web/snapshot/baidu/RectangleRetrievel",
                 success: function (data) {
                   console.log(data);
                   if (data.status == 0) {
                     $.each(data.results,function(i,row){
                    if(row.bayonet=="1"){
                     var id=row.devName.substr(0,5);
                   var devid=wkkid(id);
                   row.devId=devid;
                    }
                 })
                     $("#sql_con").empty();
                     var startRow = (page - 1) * rows;
                     var endRow = startRow + rows;
                     if (list.length > 0) {
                       $.each(data.results, function (i, row) {
                         for (var j = 0; j < list.length; j++) {
                           if (row.devId == list[j].devId) {
                             data.results.splice(i, 1);
                             break;
                           }
                         }
                       })
                       list = data.results.concat(list)
                     } else {
                       list = data.results;
                     }
                     let arr = list;
                     let sbs = new Array();
                     for (let i = 0; i < arr.length; i++) {
                       let sb = new Object();
                       sb.DeviceId = arr[i].devId;
                       sbs.push(sb);
                     }
                     window.parent.postMessage(sbs, "*");
                     var tempData = list.slice(startRow, endRow);
                     $.each(tempData, function (i, item) {
                       if (item.OBJECTID != null) {
                         if (item.bayonet == "") {
                           _html += `<div class="spl_res_item"  onclick="bayonet(this);" style="cursor:pointer;" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"  data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon10.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>非微卡口</p><p>${item.streetname}</p></div></div>`;
                         } else {
                           _html += `<div class="spl_res_item"  onclick="bayonet(this);" style="cursor:pointer;" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"   data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/sp_licon8.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>微卡口</p><p>${item.streetname}</p></div></div>`;
                         }
                       } else {
                         locations = item.location.coordinates[0][item.location.coordinates[0].length - 1];
                         _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.address}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.zhenming}">${item.zhenming}工地</h4><p>${item.bhhdlmc}</p><p style="width: 250px">${item.address}</p></div></div>`;
                       }
                     });
                     $("#total").text(list.length);
                     total = list.length;
                     $("#sql_con").empty();
                     $("#spl_con").html(_html);

                     //分页
                     layui.use(['laypage', 'layer'], function () {
                       var laypage = layui.laypage;
                       laypage.render({
                         //存放分页的div
                         elem: 'spl_pages',
                         //查询到的数据总数
                         count: total,
                         //每页显示的行数
                         limit: rows,
                         curr: page,
                         layout: ['prev', 'page', 'next', 'refresh', 'skip'],
                         jump: function (obj, first) {
                           page = obj.curr;
                           limit = obj.limit;
                           if (!first) {
                             _html = "";
                             startRow = (page - 1) * rows;
                             endRow = startRow + rows;
                             tempData = list.slice(startRow, endRow);
                             $.each(tempData, function (i, item) {
                               if (item.OBJECTID != null) {
                                 if (item.bayonet == "") {
                                   _html += `<div class="spl_res_item"  onclick="bayonet(this);" lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}"  devid="${item.devId}" devname="${item.devName}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon10.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>非微卡口</p><p>${item.streetname}</p></div></div>`;
                                 } else {
                                   _html += `<div class="spl_res_item"  onclick="bayonet(this);" devid="${item.devId}" devname="${item.devName}"  lon="${item.location.coordinates[0]}" lat="${item.location.coordinates[1]}" style="cursor:pointer;"  data-src="images/480.mp4"><div class="spl_res_icon" ><img src="images/sp_licon8.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.devName}">${item.devName}</h4><p>微卡口</p><p>${item.streetname}</p></div></div>`;
                                 }
                               } else {
                                 locations = item.location.coordinates[0][item.location.coordinates[0].length - 1];
                                 _html += `<div class="spl_res_item"  onclick="bayonetwork(this);" lon="${locations[0]}" lat="${locations[1]}" adress="${item.address}"  style="cursor:pointer;" data-src="images/480.mp4" ><div class="spl_res_icon"><img src="images/sp_licon16.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${item.zhenming}">${item.zhenming}工地</h4><p>${item.bhhdlmc}</p><p style="width: 250px">${item.address}</p></div></div>`;
                               }
                             });
                             $("#sql_con").empty();
                             $("#spl_con").html(_html);
                           }
                         }
                       });
                     });


                   }
                 }
               });
             }
           }

         } else {
           alert("暂无选中区域");
         }
       }
     }

})